package com.tebiecloud.base.server.service.impl;

import com.tebiecloud.base.client.model.entity.BaseRole;
import com.tebiecloud.base.server.mapper.BaseRoleMapper;
import com.tebiecloud.base.server.mapper.BaseRoleUserMapper;
import com.tebiecloud.base.server.service.BaseRoleService;
import com.tebiecloud.common.mybatis.base.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 系统角色-基础信息 服务实现类
 * @author tebie
 * @date 2019-08-01
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class BaseRoleServiceImpl extends BaseServiceImpl<BaseRoleMapper, BaseRole> implements BaseRoleService {

    @Autowired
    private BaseRoleUserMapper baseRoleUserMapper;

    /**
     * 获取组员角色
     * @param userId
     * @return
     */
    @Override
    public List<BaseRole> getBaseRoleList(Long userId) {
        List<BaseRole> roles = baseRoleUserMapper.selectBaseRoleList(userId);
        return roles;
    }

}
